package com.etennis.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.etennis.mapper.SeasonInfoMapper;
import com.etennis.pojos.entity.Seasoninfo;
import com.etennis.pojos.vo.web.GroupCountVO;
import com.etennis.service.ISeasonInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SeasonInfoServiceImpl extends ServiceImpl<SeasonInfoMapper, Seasoninfo> implements ISeasonInfoService {
    @Autowired
    SeasonInfoMapper seasonInfoMapper;

    @Override
    public GroupCountVO groupCount() {
        // todo seasonId
        Long seasonId=1L;
        GroupCountVO groupCountVO = new GroupCountVO();
        Integer count = seasonInfoMapper.groupCount(1,seasonId);
        groupCountVO.setSilver(count);
        count = seasonInfoMapper.groupCount(2,seasonId);
        groupCountVO.setGold(count);
        count = seasonInfoMapper.groupCount(3,seasonId);
        groupCountVO.setDiamond(count);
        count = seasonInfoMapper.groupCount(4,seasonId);
        groupCountVO.setMaster(count);

        return groupCountVO;
    }
}
